<template>
  <NScrollbar style="height:100dvh">
    <!-- 页头 菜单 -->
    <PageHead style="position: sticky;top:0;z-index: 2;" />
    <!-- 路由视图 -->
    <RouterView />
    <!-- 页尾 -->
  </NScrollbar>
</template>

<script setup lang="ts">
import { RouterView } from 'vue-router'
import router from "@/router";
import { createDiscreteApi, NScrollbar } from "naive-ui";
import PageHead from "@/components/PageHead.vue";

import { loginStatus } from "@/stores/counter";

const login_status = loginStatus();

//导入全局交互组件。
//要在 tsconfig.json 里面增加 window 的接口，否则会报错。
window.$utils = createDiscreteApi(['message', 'dialog', 'notification', 'loadingBar', 'modal']);




// onMounted(() => {
//   loginUitls.relogin();
// })

// // router.beforeEach((to, from, next) => {
// //   if (to.name !== 'login' && !login_status.isLogin) next({ name: 'login' })
// //   else next()
// // })


</script>

<style>
/* these are necessary styles for vue flow */
@import '@vue-flow/core/dist/style.css';

/* this contains the default theme, these are optional styles */
@import '@vue-flow/core/dist/theme-default.css';

@font-face {
  font-family: "ZSFT-hk";
  src: url("https://fontsapi.zeoseven.com/hk/main.woff2") format("woff2"),
    url("https://fontsapi-storage.zeoseven.com/hk/main.woff2") format("woff2");
  font-display: swap;
}

code {
  font-family: "ZSFT-hk";
  font-weight: normal;
}
</style>